package com.szqhyxj.youxiangju.biz.merchantHome.home;

import com.google.gson.annotations.SerializedName;
import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.POST;


/**
 * Created by leung on 2018/10/30.
 */

public class HomeModel {

    public interface BannerSerivce {
        @POST("ad/query")
        Observable<BaseResult<BannerResult>> get();

        @POST("onlineInvite/inviteTips")
        Observable<BaseResult<Vipentity>> getVipInfo();
    }


    public static Observable<BaseResult<BannerResult>> getBanner() {
        return RetrofitFacade.Companion.getRetrofit().create(BannerSerivce.class).get();
    }

    public static Observable<BaseResult<Vipentity>> getVipInfo(){
        return RetrofitFacade.Companion.getMockretrofit().create(BannerSerivce.class).getVipInfo();
    }

    public static class BannerResult {

        @SerializedName("adBanner")
        private List<AdBannerItem> adBanner;

        @SerializedName("bankBanner")
        private List<BankBannerItem> bankBanner;

        public void setAdBanner(List<AdBannerItem> adBanner) {
            this.adBanner = adBanner;
        }

        public List<AdBannerItem> getAdBanner() {
            return adBanner;
        }

        public void setBankBanner(List<BankBannerItem> bankBanner) {
            this.bankBanner = bankBanner;
        }

        public List<BankBannerItem> getBankBanner() {
            return bankBanner;
        }

        @Override
        public String toString() {
            return
                    "BannerResult{" +
                            "adBanner = '" + adBanner + '\'' +
                            ",bankBanner = '" + bankBanner + '\'' +
                            "}";
        }
    }

    public static class BankBannerItem {

        @SerializedName("imgUrl")
        private String imgUrl;

        @SerializedName("isUse")
        private int isUse;

        @SerializedName("offline")
        private int offline;

        @SerializedName("btCode")
        private String btCode;

        @SerializedName("serviceTel")
        private String serviceTel;

        @SerializedName("webUrl")
        private String webUrl;

        @SerializedName("bannerUrl")
        private Object bannerUrl;

        @SerializedName("recommend")
        private int recommend;

        @SerializedName("details")
        private Object details;

        @SerializedName("addDate")
        private Object addDate;

        @SerializedName("btName")
        private String btName;

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setIsUse(int isUse) {
            this.isUse = isUse;
        }

        public int getIsUse() {
            return isUse;
        }

        public void setOffline(int offline) {
            this.offline = offline;
        }

        public int getOffline() {
            return offline;
        }

        public void setBtCode(String btCode) {
            this.btCode = btCode;
        }

        public String getBtCode() {
            return btCode;
        }

        public void setServiceTel(String serviceTel) {
            this.serviceTel = serviceTel;
        }

        public String getServiceTel() {
            return serviceTel;
        }

        public void setWebUrl(String webUrl) {
            this.webUrl = webUrl;
        }

        public String getWebUrl() {
            return webUrl;
        }

        public void setBannerUrl(Object bannerUrl) {
            this.bannerUrl = bannerUrl;
        }

        public Object getBannerUrl() {
            return bannerUrl;
        }

        public void setRecommend(int recommend) {
            this.recommend = recommend;
        }

        public int getRecommend() {
            return recommend;
        }

        public void setDetails(Object details) {
            this.details = details;
        }

        public Object getDetails() {
            return details;
        }

        public void setAddDate(Object addDate) {
            this.addDate = addDate;
        }

        public Object getAddDate() {
            return addDate;
        }

        public void setBtName(String btName) {
            this.btName = btName;
        }

        public String getBtName() {
            return btName;
        }

        @Override
        public String toString() {
            return
                    "BankBannerItem{" +
                            "imgUrl = '" + imgUrl + '\'' +
                            ",isUse = '" + isUse + '\'' +
                            ",offline = '" + offline + '\'' +
                            ",btCode = '" + btCode + '\'' +
                            ",serviceTel = '" + serviceTel + '\'' +
                            ",webUrl = '" + webUrl + '\'' +
                            ",bannerUrl = '" + bannerUrl + '\'' +
                            ",recommend = '" + recommend + '\'' +
                            ",details = '" + details + '\'' +
                            ",addDate = '" + addDate + '\'' +
                            ",btName = '" + btName + '\'' +
                            "}";
        }
    }

    public static class AdBannerItem {

        @SerializedName("imgUrl")
        private String imgUrl;

        @SerializedName("adId")
        private int adId;

        @SerializedName("bannerType")
        private int bannerType;

        @SerializedName("adContent")
        private Object adContent;

        @SerializedName("adIndex")
        private int adIndex;

        @SerializedName("adTitle")
        private Object adTitle;

        @SerializedName("adSecondTitle")
        private Object adSecondTitle;

        @SerializedName("linkUrl")
        private Object linkUrl;

        @SerializedName("positionCode")
        private String positionCode;

        @SerializedName("addDate")
        private String addDate;

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setAdId(int adId) {
            this.adId = adId;
        }

        public int getAdId() {
            return adId;
        }

        public void setBannerType(int bannerType) {
            this.bannerType = bannerType;
        }

        public int getBannerType() {
            return bannerType;
        }

        public void setAdContent(Object adContent) {
            this.adContent = adContent;
        }

        public Object getAdContent() {
            return adContent;
        }

        public void setAdIndex(int adIndex) {
            this.adIndex = adIndex;
        }

        public int getAdIndex() {
            return adIndex;
        }

        public void setAdTitle(Object adTitle) {
            this.adTitle = adTitle;
        }

        public Object getAdTitle() {
            return adTitle;
        }

        public void setAdSecondTitle(Object adSecondTitle) {
            this.adSecondTitle = adSecondTitle;
        }

        public Object getAdSecondTitle() {
            return adSecondTitle;
        }

        public void setLinkUrl(Object linkUrl) {
            this.linkUrl = linkUrl;
        }

        public Object getLinkUrl() {
            return linkUrl;
        }

        public void setPositionCode(String positionCode) {
            this.positionCode = positionCode;
        }

        public String getPositionCode() {
            return positionCode;
        }

        public void setAddDate(String addDate) {
            this.addDate = addDate;
        }

        public String getAddDate() {
            return addDate;
        }

        @Override
        public String toString() {
            return
                    "AdBannerItem{" +
                            "imgUrl = '" + imgUrl + '\'' +
                            ",adId = '" + adId + '\'' +
                            ",bannerType = '" + bannerType + '\'' +
                            ",adContent = '" + adContent + '\'' +
                            ",adIndex = '" + adIndex + '\'' +
                            ",adTitle = '" + adTitle + '\'' +
                            ",adSecondTitle = '" + adSecondTitle + '\'' +
                            ",linkUrl = '" + linkUrl + '\'' +
                            ",positionCode = '" + positionCode + '\'' +
                            ",addDate = '" + addDate + '\'' +
                            "}";
        }
    }

    public static class Vipentity {
        private String profitSum;
        private String surplus;
        private String certified;

        public void setProfitSum(String profitSum){
            this.profitSum = profitSum;
        }

        public String getProfitSum(){
            return profitSum;
        }

        public void setSurplus(String surplus){
            this.surplus = surplus;
        }

        public String getSurplus(){
            return surplus;
        }

        public void setCertified(String certified){
            this.certified = certified;
        }

        public String getCertified(){
            return certified;
        }

        @Override
         public String toString(){
            return
                "Response{" +
                "profitSum = '" + profitSum + '\'' +
                ",surplus = '" + surplus + '\'' +
                ",certified = '" + certified + '\'' +
                "}";
            }
    }
}
